const {$Toast} = require('../asserts/iview/base/index');
Page({
  data: {
    editText: '',
    index: 0,
    key: '',
    itemArr: []
  },
  onLoad: function(option) {
    wx.showLoading({
      title: '加载中',
      mask: true
    });
    let itemArrStr = wx.getStorageSync(option.key);
    this.setData({
      editText: option.editText,
      index: option.index,
      key: option.key,
      itemArr: itemArrStr ? JSON.parse(itemArrStr) : []
    });
  },
  onReady: function() {
    wx.hideLoading({});
    if (this.data.itemArr.length == 0) {
      $Toast({
        content: '暂无数据，请添加'+this.data.editText
      });
    }
  },
  editSubMenu: () => {

  }
});